/PROG  PNS0023
/ATTR
OWNER		= MNEDITOR;
COMMENT		= "SGH_1475_76_77";
PROG_SIZE	= 3297;
CREATE		= DATE 23-04-27  TIME 13:03:58;
MODIFIED	= DATE 23-05-31  TIME 08:47:14;
FILE_NAME	= PNS0015;
VERSION		= 0;
LINE_COUNT	= 121;
MEMORY_SIZE	= 3757;
PROTECT		= READ_WRITE;
TCD:  STACK_SIZE	= 0,
      TASK_PRIORITY	= 50,
      TIME_SLICE	= 0,
      BUSY_LAMP_OFF	= 0,
      ABORT_REQUEST	= 0,
      PAUSE_REQUEST	= 0;
DEFAULT_GROUP	= 1,*,*,*,*;
CONTROL_CODE	= 00000000 00000000;
/APPL
/MN
   1:  !******************************** ;
   2:  !     COSMA METAL FORMING  ;
   3:  !******************************** ;
   4:  !  LINE: CHINA CHANGSHA ;
   5:  !  ROBOT: RL1 ;
   6:  !  PROGRAM: PNS0015 ;
   7:  !  PART:LYRA3358/3366 ;
   8:  !ZYL15-7-16********************** ;
   9:   ;
  10:  !INITIALIZE ;
  11:  MOVE TO HOME    ;
  12:  DO[38]=OFF ;
  13:  R[14]=90    ;
  14:  R[18]=1    ;
  15:  R[19]=.1    ;
  16:  R[35]=TIMER[4]    ;
  17:  !------------------------------- ;
  18:  !BEGINNING OF PROGRAM ;
  19:  CALL PARTDROP    ;
  20:  COL GUARD ADJUST R[14] ;
  21:  UTOOL_NUM=1 ;
  22:  UFRAME_NUM=0 ;
  23:  PAYLOAD[1] ;
  24:  CALL ARM_CHECK    ;
  25:  !INITIATE TO PICK-POUNCE ;
  26:J P[1:MIDDLE] 50% CNT100 ACC100    ;
  27:J P[2:PICK POUNCE] 50% CNT100 ACC100 BREAK    ;
  28:  PR[6]=PR[28]    ;
  29:  R[1]=0    ;
  30:  TIMER[1]=RESET ;
  31:   ;
  32:  LBL[10:TOP OF LOOF] ;
  33:  OVERRIDE=R[5] ;
  34:   ;
  35:  !PROCEED TO PICK ;
  36:  LBL[20] ;
  37:  IF DI[1]=ON AND DI[2]=ON,JMP LBL[40] ;
  38:  IF DI[29]=ON,JMP LBL[90] ;
  39:  JMP LBL[20] ;
  40:   ;
  41:  LBL[40:MEASURE HEIGHT?] ;
  42:  IF DI[2]=ON AND DI[4]=ON AND DI[44]=ON AND DI[46]=ON,JMP LBL[70] ;
  43:   ;
  44:  IF DI[2]=ON AND DI[4]=ON AND DI[44]=ON,JMP LBL[30] ;
  45:  IF DI[29]=ON,JMP LBL[90] ;
  46:  JMP LBL[40] ;
  47:   ;
  48:  LBL[70:MEASURE HEGHT ] ;
  49:  OVERRIDE=R[5] ;
  50:   ;
  51:  PR[5]=PR[28]    ;
  52:  PR[5,3]=PR[28,3]-650    ;
  53:J P[3:SAFE POUNCE] 30% CNT30    ;
  54:  SKIP CONDITION DI[9]=ON OR DI[11]=ON    ;
  55:  CALL PARTPICK    ;
  56:L PR[28] 100mm/sec CNT30    ;
  57:L PR[5] 70mm/sec CNT30 Skip,LBL[80],PR[6]=LPOS    ;
  58:  LBL[80] ;
  59:  DO[37]=PULSE,1.0sec ;
  60:  CALL PARTDROP    ;
  61:  DO[41]=PULSE,2.0sec ;
  62:   ;
  63:J P[3:SAFE POUNCE] 30% CNT30    ;
  64:  PAUSE ;
  65:  //    ;
  66:  JMP LBL[30] ;
  67:   ;
  68:  LBL[30:GOTO DROP POUNCE] ;
  69:  OVERRIDE=R[5] ;
  70:  DO[38]=ON ;
  71:  R[45]=PR[6,3]    ;
  72:  IF DI[29]=ON,JMP LBL[90] ;
  73:  IF DI[2]=ON AND DI[4]=ON AND DI[44]=ON AND DI[45]=OFF AND DI[38]=ON,JMP LBL[50] ;
  74:  JMP LBL[30] ;
  75:  LBL[50:MOVE TO PICK POS] ;
  76:  WAIT DI[5]=ON    ;
  77:J P[3:SAFE POUNCE] 30% CNT30    ;
  78:   ;
  79:  OVERRIDE=R[5] ;
  80:  IF R[45]<=(-1520),JMP LBL[98] ;
  81:  JMP LBL[99] ;
  82:  LBL[98] ;
  83:  DO[40]=PULSE,1.0sec ;
  84:  LBL[99] ;
  85:   ;
  86:L PR[6] 550mm/sec CNT0 DB  100.0mm,DO[37]=PULSE,1.5sec ACC100    ;
  87:   ;
  88:L PR[6] 550mm/sec CNT0 TB    .60sec,CALL PARTPICK ACC100    ;
  89:  CALL CHK_PICK    ;
  90:  WAIT    .40(sec) ;
  91:L P[5] 1000mm/sec CNT30    ;
  92:  WAIT DI[4]=ON AND DI[5]=ON AND DI[38]=ON AND DI[45]=OFF    ;
  93:  PR[6,3]=PR[6,3]-1.4    ;
  94:  DO[38]=OFF ;
  95:J P[10] 30% CNT30    ;
  96:J P[11:DROP] 20% CNT5 TB R[19]sec,CALL PARTDROP_L BREAK    ;
  97:J P[12] 100% CNT100    ;
  98:J P[20] 100% CNT100    ;
  99:J P[21:DROP] 20% CNT5 TB R[19]sec,CALL PARTDROP_R BREAK    ;
 100:  CALL CHK_DROP    ;
 101:J P[22] 100% CNT100    ;
 102:  DO[6]=PULSE,1.0sec ;
 103:J P[2:PICK POUNCE] 50% CNT100    ;
 104:  DO[38]=ON ;
 105:  IF DI[29]=ON,JMP LBL[90] ;
 106:  IF DI[44]=ON,JMP LBL[30] ;
 107:  JMP LBL[86] ;
 108:  LBL[86] ;
 109:  DO[22]=PULSE,3.0sec ;
 110:  JMP LBL[89] ;
 111:  LBL[89] ;
 112:  IF DI[29]=ON,JMP LBL[90] ;
 113:  JMP LBL[10] ;
 114:  LBL[90:END OF CYCLE] ;
 115:  TIMER[1]=STOP ;
 116:J P[2:PICK POUNCE] 85% CNT100    ;
 117:J P[8:DROP POUNCE] 5% CNT100    ;
 118:  MOVE TO HOME    ;
 119:  DO[38]=OFF ;
 120:  R[38]=0    ;
 121:  LBL[100:END OF PROGRAM] ;
/POS
P[1:"MIDDLE"]{
   GP1:
	UF : 0, UT : 1,		CONFIG : 'N U T, 0, 0, 0',
	X =  2659.977  mm,	Y =  -743.246  mm,	Z =  -788.846  mm,
	W =  -179.313 deg,	P =      .576 deg,	R =   -89.994 deg
};
P[2:"PICK POUNCE"]{
   GP1:
	UF : 0, UT : 1,		CONFIG : 'N U T, 0, 0, 0',
	X =  2650.000  mm,	Y = -1261.553  mm,	Z =  -810.552  mm,
	W =   179.911 deg,	P =      .056 deg,	R =   -90.020 deg
};
P[3:"SAFE POUNCE"]{
   GP1:
	UF : 0, UT : 1,		CONFIG : 'N U T, 0, 0, 0',
	X =  2649.822  mm,	Y = -2451.363  mm,	Z =  -901.359  mm,
	W =   179.972 deg,	P =      .016 deg,	R =   -90.007 deg
};
P[5]{
   GP1:
	UF : 0, UT : 1,		CONFIG : 'N U T, 0, 0, 0',
	X =  2649.523  mm,	Y = -2451.067  mm,	Z =  -821.916  mm,
	W =   179.950 deg,	P =      .030 deg,	R =   -90.008 deg
};
P[8:"DROP POUNCE"]{
   GP1:
	UF : 0, UT : 1,		CONFIG : 'N U T, 0, 0, 0',
	X =  2808.447  mm,	Y =  -390.819  mm,	Z =  -810.731  mm,
	W =   179.917 deg,	P =      .059 deg,	R =   -90.026 deg
};
P[10]{
   GP1:
	UF : 0, UT : 1,		CONFIG : 'N U T, 0, 0, 0',
	X =  2971.546  mm,	Y = -2451.230  mm,	Z =  -810.192  mm,
	W =   179.933 deg,	P =      .041 deg,	R =   -90.016 deg
};
P[11:"DROP"]{
   GP1:
	UF : 0, UT : 1,		CONFIG : 'N U T, 0, 0, 0',
	X =  2972.096  mm,	Y = -2451.049  mm,	Z =  -861.846  mm,
	W =   179.940 deg,	P =      .035 deg,	R =   -90.011 deg
};
P[12]{
   GP1:
	UF : 0, UT : 1,		CONFIG : 'N U T, 0, 0, 0',
	X =  2971.540  mm,	Y = -2451.238  mm,	Z =  -810.192  mm,
	W =   179.933 deg,	P =      .041 deg,	R =   -90.016 deg
};
P[20]{
   GP1:
	UF : 0, UT : 1,		CONFIG : 'N U T, 0, 0, 0',
	X =  2316.938  mm,	Y = -2531.841  mm,	Z =  -810.452  mm,
	W =   179.913 deg,	P =      .055 deg,	R =   -90.021 deg
};
P[21:"DROP"]{
   GP1:
	UF : 0, UT : 1,		CONFIG : 'N U T, 0, 0, 0',
	X =  2317.098  mm,	Y = -2531.925  mm,	Z =  -870.843  mm,
	W =   179.923 deg,	P =      .049 deg,	R =   -90.020 deg
};
P[22]{
   GP1:
	UF : 0, UT : 1,		CONFIG : 'N U T, 0, 0, 0',
	X =  2316.938  mm,	Y = -2531.841  mm,	Z =  -810.452  mm,
	W =   179.913 deg,	P =      .055 deg,	R =   -90.021 deg
};
/END
